package com.rd.student.jike.class1.fangzhou.day0801;

import java.util.Arrays;

public class Test01 {
    public static void main(String[] args) {
        int[] arr1 = {1,3,5,7,9,11,13,15,17,0};
        arrayAdd(arr1,10);
        System.out.println(Arrays.toString(arr1));
    }
    public static void arrayAdd(int[] arr, int num){
        int i;
        for(i = 0;i<arr.length;i++){
            if(arr[i]>num||arr[i]==0){
                break;
            }
        }
        int temp;
        while(i< arr.length){
            temp = arr[i];
            arr[i++]=num;
            num = temp;
        }
    }
}
